<?php
function bt_paginate()
{
		$prev = get_bloginfo('template_url')."/images/pre_03.jpg";
		$next = get_bloginfo('template_url')."/images/next_05.jpg";
		global $wp_query, $wp_rewrite;
		$wp_query->query_vars['paged'] > 1 ? $current = $wp_query->query_vars['paged'] : $current = 1;
		$pagination = array(
	    'base'         => @add_query_arg('paged','%#%'),
	    'format'       => '',
	    'total'        => $wp_query->max_num_pages,
	    'current'      => $current,
	    'show_all'     => false,
	    'end_size'     => 1,
	    'mid_size'     => 2,
	    'prev_next'    => true,
	    'prev_text'    => __('<img src="'.$prev.'" alt=" "'),
        'next_text'    => __('<img src="'.$next.'" alt=""'),
	    'type'         => 'plain',
	    'add_args'     => true,
		 'add_fragment' =>''  );

		if( $wp_rewrite->using_permalinks() )
			$pagination['base'] = user_trailingslashit( trailingslashit( remove_query_arg( 's', get_pagenum_link( 1 ) ) ) . 'page/%#%/', 'paged' );

		if( !empty($wp_query->query_vars['s']) )
			$pagination['add_args'] = array( 's' => str_replace(' ', '+',stripslashes(strip_tags(get_search_query())) ));

		echo paginate_links( $pagination );
}
?>